//
//  HealthDataViewController.m
//  DefendHealth
//
//  Created by 吾诺翰卓003 on 17/2/21.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "HealthDataViewController.h"

@interface HealthDataViewController ()

@end

@implementation HealthDataViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.TitleNav.text = @"健康数据";
    UIView *hui = [UIView new];
    hui.frame = CGRectMake(12, 63.5,WindowWidth-24 , 0.5);
    hui.backgroundColor = kLineColor;
    [self.view addSubview:hui];
    [self addView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)addView{
    UIView *view1 = [UIView new];
    view1.frame = CGRectMake(0, 64,WindowWidth , 93);
    view1.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:view1];
    
    UILabel *lab1 = [UILabel new];
    lab1.frame = CGRectMake(10, 15, 118, 12);
    lab1.text = @"BMI";
    lab1.font = FONT(12);
    lab1.textColor = UIColorFromRGB(0x333333);
    lab1.textAlignment = 0;
    [view1 addSubview:lab1];
    
    UILabel *lab2 = [UILabel new];
    lab2.frame = CGRectMake(0, 30, WindowWidth, 38);
    lab2.text = @"26";
    lab2.font = [UIFont systemFontOfSize:38 weight:4];
    lab2.textColor = UIColorFromRGB(0x231815);
    lab2.textAlignment = 1;
    [view1 addSubview:lab2];
    
    UILabel *lab3 = [UILabel new];
    lab3.frame = CGRectMake(WindowWidth-10-100, 15, 100, 12);
    lab3.text = @"关于BMI";
    lab3.font = FONT(12);
    lab3.textColor = UIColorFromRGB(0x333333);
    lab3.textAlignment = 2;
    [view1 addSubview:lab3];
    
    UIView *hui = [UIView new];
    hui.frame = CGRectMake(10, kMaxY(view1.frame),WindowWidth-20 , 5);
    hui.backgroundColor = kLineColor;
    [self.view addSubview:hui];
    
    NSArray *titleArr = @[@"生日",@"身高",@"体重"];
    NSArray *contentArr = @[@"1994-10-30",@"185cm",@"+"];
    for (int i = 0; i<titleArr.count; i++) {
        UIView *view5 = [UIView new];
        view5.frame = CGRectMake(0, kMaxY(hui.frame)+47*i,WindowWidth , 47);
        view5.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:view5];
        
        UILabel *lab1 = [UILabel new];
        lab1.frame = CGRectMake(10, 0, 118, 47);
        lab1.text = titleArr[i];
        lab1.font = FONT(16);
        lab1.textColor = UIColorFromRGB(0x333333);
        lab1.textAlignment = 0;
        [view5 addSubview:lab1];
        
        UIImageView *right = [UIImageView new];
        right.frame = CGRectMake(WindowWidth-10-7, 18, 7, 11);
        right.image = [UIImage imageNamed:@"point"];
        [view5 addSubview:right];
        
        UILabel *lab2 = [UILabel new];
        lab2.frame = CGRectMake(WindowWidth-12-10-12-200, 0, 200, 47);
        lab2.text = contentArr[i];
        lab2.font = FONT(14);
        lab2.textColor = UIColorFromRGB(0x333333);
        lab2.textAlignment = 2;
        [view5 addSubview:lab2];
        
        UIView *hui = [UIView new];
        hui.frame = CGRectMake(10, 46.5,WindowWidth-20 , 0.5);
        hui.backgroundColor = kLineColor;
        [view5 addSubview:hui];
        
        if (i == 2) {
            right.hidden = YES;
            lab2.frame = CGRectMake(WindowWidth-10-200, 0, 200, 47);
            lab2.font = FONT(35);
            hui.hidden = YES;
        }
    }
    
    UIView *huiview1 = [UIView new];
    huiview1.frame = CGRectMake(10, kMaxY(hui.frame)+47*3,WindowWidth-20 , 138);
    huiview1.backgroundColor = UIColorFromRGB(0xebebea);
    [self.view addSubview:huiview1];
    
    UILabel *kgLab = [UILabel new];
    kgLab.frame = CGRectMake(10, 17.5, 118, 12);
    kgLab.text = @"73kg";
    kgLab.font = FONT(10);
    kgLab.textColor = UIColorFromRGB(0x949494);
    kgLab.textAlignment = 0;
    [huiview1 addSubview:kgLab];
    
    UILabel *kgLab2 = [UILabel new];
    kgLab2.frame = CGRectMake(10, kMaxY(kgLab.frame)+65, 118, 12);
    kgLab2.text = @"69kg";
    kgLab2.font = FONT(10);
    kgLab2.textColor = UIColorFromRGB(0x949494);
    kgLab2.textAlignment = 0;
    [huiview1 addSubview:kgLab2];
}

@end
